<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE>
<html>
<head>
<jsp:include page="../header.jsp">
	<jsp:param value="缴费记录查询" name="title" />
</jsp:include>
<link href="static/css/couselor.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="static/js/job.js"></script>
<script type="text/javascript"
	src="${basePath }My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	function searchTime() {
		$('#submit').attr("disabled", "disabled");
		var $start = $('#start');
		var $end = $('#end');
		if ($start.val() > $end.val()) {
			alert("起止时间大于结束时间！")
		} else {
			$('#submit').removeAttr("disabled");
		}
	}

	function searchName() {
		var $start = $('#start');
		var $end = $('#end');
		if ($('#empName').val() || $('#stuName').val()) {
			if ($start.val() > $end.val()) {
				$('#submit').attr("disabled", "disabled");
			} else {
				$('#submit').removeAttr("disabled");
			}
		}
	}
	function search() {
		var $start = $('#start');
		var $end = $('#end');
		if ($start.val().length == 0 && $end.val().length > 0
				|| $end.val().length == 0 && $start.val().length > 0) {
			if ($end.val().length == 0) {
				$('#submit').attr("disabled", "disabled");
				alert("请输入结束时间！");
			} else {
				if ($start.val() > $end.val()) {
					$('#submit').attr("disabled", "disabled");
					alert("起止时间大于结束时间！");
				} else {
					if ($start.val().length == 0) {
						$('#submit').attr("disabled", "disabled");
						alert("请输入开始时间！");
					}
				}
			}
		}
	}
</script>
</head>
<body>
	<jsp:include page="../menu/menue.jsp"></jsp:include>
	<div class="detailForm">
		<h4 class="ui left floated detail ">缴费详情查询</h4>
		<div class="ui clearing divider"></div>
		<form class="form">
			<table class="ui celled table">
				<tbody>
					<tr>
						<td>学员姓名：<input id="stuName" type="text" name="stuName"
							onchange="searchName()" value="${param.stuName}"
							onkeyup="searchName()"></td>
						<td>员工姓名： <input type="text" id="empName"
							onchange="searchName()" value="${param.empName}" name="empName"
							onkeyup="searchName()">
						</td>
						<td><span>起止时间：</span> <input type="text" id="start"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" name="startTime" onchange="searchTime()"
							value="${start}" /></td>
						<td><span>结束时间：</span><input type="text" id="end"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" name="endTime" onchange="searchTime()"
							value="${end}" /></td>

						<td>
							<button class="ui button" tabindex="0" type="submit" id="submit"
								style="text_align: center;" onclick="search()">查询</button>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
		<div class="ui segment">
			<c:if test="${empty studentPayList }">
				<div class="ui segment" style="text-align: center;">没有记录</div>
			</c:if>
			<c:forEach var="student" items="${ studentPayList}">
				<div class="ui segment">
					<div class="ui grid">
						<div class="column" style="color: red;">缴费单号：${student.payOrderId }</div>
					</div>
					<div class="ui grid">
						<div class="four wide column">收款员工：${student.empName }</div>
						<div class="four wide column">缴费金额：${student.thisPay }</div>
						<div class="four wide column">
							收款时间：
							<fmt:formatDate value="${student.payDate}" type="both" />
						</div>
					</div>

				</div>
			</c:forEach>
			<c:if test="${totalPage > 1 }">
				<div class="page">
					<a
						<c:if test="${page!=1}">href="${url}?page=1${queryString}"</c:if>
						class="${page == 1?'disable':''}">首页</a> <a
						<c:if test="${page!=1}">href="${url}?page=${page-1}${queryString}"</c:if>
						class="${page == 1?'disable':''}">上一页</a> <a
						<c:if test="${page!=totalPage}">href="${url}?page=${page+1 }${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">下一页</a> <a
						<c:if test="${page!=totalPage}">href="${url}?page=${totalPage }${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">最后一页</a> <span>
						${page}/${totalPage} </span>
				</div>
			</c:if>
		</div>
	</div>
</body>
</html>